<%--
  Created by IntelliJ IDEA.
  User: Tony
  Date: 2017/8/22
  Time: 11:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java"  pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/views/common/taglib.jsp" %>
<html>
<head>
    <title>店铺列表</title>
    <%@ include file="/WEB-INF/views/common/resource.jsp" %>
    <link rel="stylesheet" type="text/css" href="${rtx}/css/upload_style.css"/>
</head>
<body>
<div class="wrapper wrapper-content animated fadeInRight">
    <form action="/shops/exportShopInfo" method="post" target="_blank">
    <div class="row">
        <div class="form-group">
            <label class="col-sm-1">所在地区</label>
            <div class="col-sm-2">
                <select class="form-control m-b" name="city" id="city" onchange="getArea()">
                    <option value="">全部</option>
                    <option value="1">上海</option>
                    <option value="2">南通</option>
                    <option value="3">常熟</option>
                    <option value="4">嘉兴</option>
                    <option value="5">苏州</option>
                    <option value="6">无锡</option>
                </select>
            </div>
            <div class="col-sm-2">
                <select class="form-control m-b" name="area" id="area">
                    <option value="">请选择所在地区</option>
                </select>
            </div>

            <label class="col-sm-1 control-label">手机号码</label>
            <div class="col-sm-2">
                <div class="row">
                    <input type="text" id="shop_mobile" name="shop_mobile" placeholder="请输入手机号码" class="form-control"/>
                </div>
            </div>

            <label class="col-sm-1 control-label">售点系统编号</label>
            <div class="col-sm-2">
                <div class="row">
                    <input type="text" id="customer_system_no" name="customer_system_no" placeholder="请输入系统编号" class="form-control"/>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="form-group">

            <label class="col-sm-1">渠道类型</label>
            <div class="col-sm-2">
                <select class="form-control m-b" name="channel_type" id="channel_type">
                    <option value="">全部</option>
                    <option value="超市">超市</option>
                    <option value="食杂店">食杂店</option>
                    <option value="餐饮">餐饮</option>
                    <option value="网吧">网吧</option>
                    <option value="其他">其他</option>
                </select>
            </div>

            <label class="col-sm-1">状态</label>
            <div class="col-sm-2">
                <select class="form-control m-b" name="check_status" id="check_status">
                    <option value="-3">全部</option>
                    <option value="1">合作中</option>
                    <option value="2">合作中+</option>
                    <option value="-2">已停用</option>
                </select>
            </div>

            <label class="col-sm-1 control-label">线路号</label>
            <div class="col-sm-2">
                <div class="row">
                    <input type="text" id="route_id2" name="route_id" placeholder="请输入线路号" class="form-control"/>
                </div>
            </div>

            <label class="col-sm-1 control-label">办事处</label>
            <div class="col-sm-2">
                <div class="row">
                    <input type="text" id="office_address2" name="office_address" placeholder="请输入办事处" class="form-control"/>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="form-group">
            <div class="col-sm-2 ">
                <button onclick="search()" style="width: 100px;" class="btn btn-primary" type="button">搜索</button>
            </div>

            <div class="col-sm-2 ">
                <button onclick="showImportTable()" style="width: 100px;" class="btn btn-primary" type="button">导入店铺</button>
                <a data-toggle="modal" style="display: none" id="showImportTable" class="btn btn-primary" href="#upload-form"></a>
            </div>

            <div class="col-sm-2 ">
                <input type="submit" style="width: 100px;" class="btn btn-primary" value="导出店铺"/>
            </div>
        </div>
    </div>
    </form>

    <div class="ibox-content">
        <div class="row ">
            <div class="col-sm-12">
                <table id="shopList" ></table>
            </div>
        </div>
    </div>
</div>

<div id="stopCustomer" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b">禁封店铺</h3>
                <div class="row">
                    <input id="stop-customer-id" type="hidden" class="form-control">
                    <div class="col-sm-12" >
                        <table width="100%">
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>店铺编号:</label>
                                        <label id="stop-customer-system-no"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>店铺名称:</label>
                                        <label id="stop-customer-name"></label>
                                     </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>联系人:</label>
                                        <label id="stop-customer-contacts"></label>
                                    </div>
                                </td>
                                <td valign="top">
                                    <div class="form-group">
                                        <label>电话号码:</label>
                                        <label id="stop-customer-mobile"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label style="vertical-align: top;">门店照片:</label>
                                        <label><a href="" id="stop-shop-img" target="_blank"><img src="" id="stop-customer-img" class="form-control" style="width: 120px;height: 120px;vertical-align:top;"/></a></label>
                                    </div>
                                </td>
                                <td valign="top">
                                    <div class="form-group">
                                        <label>地区:</label>
                                        <label id="stop-customer-city"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>门店地址:</label>
                                        <label id="stop-customer-address"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>区域:</label>
                                        <label id="stop-customer-area"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>小店面积:</label>
                                        <label id="stop-shop-size"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>渠道类型:</label>
                                        <label id="stop-channel-type"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>申美客户编号:</label>
                                        <label id="stop-customer-no"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>办事处:</label>
                                        <label id="stop-office-address"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>路线号:</label>
                                        <label id="stop-route-id"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div class="form-group" style="text-align: center">
                                        <input type="button" value="停用店铺" onclick="stopCustomer()"/>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="releaseCustomer" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b">解封店铺</h3>
                <div class="row">
                    <input id="release-customer-id" type="hidden" class="form-control">
                    <div class="col-sm-12" >
                        <table width="100%">
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>店铺编号:</label>
                                        <label id="release-customer-system-no"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>店铺名称:</label>
                                        <label id="release-customer-name"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>联系人:</label>
                                        <label id="release-customer-contacts"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>电话号码:</label>
                                        <label id="release-customer-mobile"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label style="vertical-align: top;">门店照片:</label>
                                        <label><a href="" id="release-shop-img" target="_blank"><img src="" id="release-customer-img" class="form-control" style="width: 120px;height: 120px;vertical-align:top;"/></a></label>
                                    </div>
                                </td>
                                <td valign="top">
                                    <div class="form-group">
                                        <label>地区:</label>
                                        <label id="release-customer-city"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>门店地址:</label>
                                        <label id="release-customer-address"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>区域:</label>
                                        <label id="release-customer-area"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>小店面积:</label>
                                        <label id="release-shop-size"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>渠道类型:</label>
                                        <label id="release-channel-type"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>申美客户编号:</label>
                                        <label id="release-customer-no"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>办事处:</label>
                                        <label id="release-office-address"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>路线号:</label>
                                        <label id="release-route-id"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    <div class="form-group" style="text-align: center">
                                        <input type="button" value="应用店铺" onclick="releaseCustomer()"/>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="viewCustomer" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <h3 class="m-t-none m-b">查看店铺</h3>
                <div class="row">
                    <input id="view-customer-id" type="hidden" class="form-control">
                    <div class="col-sm-12" >
                        <table width="100%">
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>店铺编号:</label>
                                        <label id="view-customer-system-no"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>店铺名称:</label>
                                        <label id="view-customer-name"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>联系人:</label>
                                        <label id="view-customer-contacts"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>电话号码:</label>
                                        <label id="view-customer-mobile"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label style="vertical-align: top;">门店照片:</label>
                                        <label><a href="" id="view-shop-img" target="_blank"><img src="" id="view-customer-img" class="form-control" style="width: 120px;height: 120px;vertical-align:top;"/></a></label>
                                    </div>
                                </td>
                                <td valign="top">
                                    <div class="form-group">
                                        <label>地区:</label>
                                        <label id="view-customer-city"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>门店地址:</label>
                                        <label id="view-customer-address"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>区域:</label>
                                        <label id="view-customer-area"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>小店面积:</label>
                                        <label id="view-shop-size"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>渠道类型:</label>
                                        <label id="view-channel-type"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>申美客户编号:</label>
                                        <label id="view-customer-no"></label>
                                    </div>
                                </td>
                                <td>
                                    <div class="form-group">
                                        <label>办事处:</label>
                                        <label id="view-office-address"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>路线号:</label>
                                        <label id="view-route-id"></label>
                                    </div>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <div class="form-group">
                                        <label>指定经销商：</label>
                                        <label id="specified_mep_no"></label>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="managerCustomer" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <input id="manager-customer-id" type="hidden" class="form-control">

                        <h3 class="m-t-none m-b">管理店铺</h3>
                        <div class="form-group">
                            <label>申美客户编号:</label>
                            <label><input type="text" id="customer_no" class="form-control"/></label>
                        </div>
                        <div class="form-group">
                            <label>办事处:</label>
                            <label><input type="text" id="office_address" class="form-control"/></label>
                        </div>
                        <div class="form-group">
                            <label>路线号:</label>
                            <label><input type="text" id="route_id" class="form-control"/></label>
                        </div>
                        <div class="form-group">
                            <label>客户子渠道编号</label>
                            <label><input type="text" id="customer_sub_channel_no" class="form-control"/></label>
                        </div>
                        <div class="form-group">
                            <label>消费者子渠道编号</label>
                            <label><input type="text" id="consumer_sub_channel_no" class="form-control"/></label>
                        </div>

                        <div class="form-group" style="text-align: center">
                            <input type="button" value="确认提交" onclick="updateManagerCustomer()"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

//导入店铺弹框
<div id="upload-form" class="modal fade" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <div class="row">
                    <div class="col-sm-12">
                        <input type="hidden" id="upload_file_url">
                        <h3 class="m-t-none m-b">导入店铺信息</h3>

                        <div id="container" class="form-group" style="text-align: center">
                            <label>上传文件：</label>
                            <a id="self" class="btn btn-primary" href="javascript:void(0);" >选择文件</a>
                            <span id="upload_file_name"></span>
                        </div>

                        <!--图片上传进度条-->
                        <div id="uploading" class="shareBox" style="z-index: 1000; margin-left: 31%">
                            <div class="uploading_bar" id="ossfile" style="z-index: 1000;"></div>
                        </div>

                        <div style="text-align: center">
                            <button class="btn btn-sm btn-primary" onclick="importShop()"><strong>确定导入</strong>
                            </button>
                            <a style="display: none" data-toggle="modal" id="loading" class="btn btn-sm btn-primary" href="#import-loading"></a>
                            <button class="btn btn-sm" onclick="$('#upload-form').click()"><strong>取消导入</strong>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="import-loading" disabled="disabled" class="modal fade" aria-hidden="true">
    <div style="background: #777 ;height: 100% ;opacity:0.1" >
    </div>
    <div class="ibox-content" style="background: none;border-color: #777;position: fixed;margin-top: -40%;margin-left:45%; border-width: 0 0;">
        <h3 style="color: white">正在处理中...</h3>
        <div class="spiner-example">
            <div class="sk-spinner sk-spinner-three-bounce">
                <div class="sk-bounce1"></div>
                <div class="sk-bounce2"></div>
                <div class="sk-bounce3"></div>
            </div>
        </div>
    </div>
</div>

</body>
<script language="javascript" type="text/javascript" src="${rtx}/js/shops/shop_manager.js"></script>
<script language="javascript" type="text/javascript" src="${rtx}/js/plupload-2.1.2/js/plupload.full.min.js"></script>
<script language="javascript" type="text/javascript" src="${rtx}/js/upload.js"></script>
</html>
